{% extends "main.html.twig" %}
{% block content %}
{% set kolumny = headers | length %}
<div style="width: {{ 150 * kolumny }}px;">
<table id="tabelka" style="width: {{ 150 * kolumny }}px;" cellpadding="0" cellspacing="0" border="0">
    <thead>
    <tr>
        {% for heading in headers %}
            <th class="{{ heading.class }}" {% if heading.getSize() != '' %}style="width: {{heading.getSize()}};"{% endif %}>
                {{heading.name}}
            </th>
        {% endfor %}
    </tr>
    </thead>
    <tbody>
    {% for row in dane %}
    <tr>
        {% for heading in headers %}<td>{{ row[heading.key] }}</td>{% endfor %}
    </tr>
    {% endfor %}
    </tbody>
</table>
</div>
<script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
        $('#tabelka').dataTable({
            aaSorting: [[ 1, "desc" ]],
            bJQueryUI: true
        });
    });
</script>
{% endblock %}